Rails Test Prescriptions (for Jennifer Saldivar) by Noel Rappin
Author:Noel Rappin
Language: eng
Format: epub, pdf
Tags: Pragmatic Bookshelf
ISBN: 1-934356-64-6
Publisher: The Pragmatic Bookshelf, LLC (271500)
context "with an admin user" do
setup do
login_as_admin
end
teardown do
logout
end
test "admin features"
# something administrative
end
end
context "with a regular user" do
setup do
login_as_normal
end
test "normal features"
# something normal
end
end
end
The tests in each context have the setup methods for that context run before each test. We can still use the standard Test::Unit setup and teardown blocks outside of any context. Those methods would be called first, before the context setup method, at the beginning of each test.
Since a simple Ruby method creates contexts, we can generate them dynamically in the same way that tests can be generated dynamically:
["admin", "root"].each do |role|
context "with a #{role} user" do
setup do
@user = User.new(:role => role)
end
Download
Rails Test Prescriptions (for Jennifer Saldivar) by Noel Rappin.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12587)
Hello! Python by Anthony Briggs(9924)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9800)
The Mikado Method by Ola Ellnestam Daniel Brolund(9784)
Dependency Injection in .NET by Mark Seemann(9347)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8309)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7770)
Grails in Action by Glen Smith Peter Ledbrook(7704)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7566)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7140)
Microservices with Go by Alexander Shuiskov(6903)
Practical Design Patterns for Java Developers by Miroslav Wengner(6820)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6760)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6423)
Angular Projects - Third Edition by Aristeidis Bampakos(6179)
The Art of Crafting User Stories by The Art of Crafting User Stories(5700)
NetSuite for Consultants - Second Edition by Peter Ries(5631)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5444)
Kotlin in Action by Dmitry Jemerov(5073)
